import java.util.Scanner;

public class Main {
    //求斐波那契数列的第n项。(迭代实现)
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret = fib(n);
        System.out.println(ret);
    }
    public static int fib(int a) {

        if(a <= 1){
            return 0;
        }else if( a <= 3) {
            return 1;
        }else {
            int a1 = 1,a2 = 1;
            int sum = 0;
            for(int i = 1; i <= a-3; i++) {
             sum = a1 + a2;
             a1 = a2;
             a2 = sum;
            }
            return sum;
        }
    }

    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret1 = fac(n);
        int ret2 = facSum(n);
        System.out.println(ret1  );
        System.out.println(ret2);
    }
    //求1！+2！+3！+4！+........+n!的和
    public static int facSum(int n) {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += fac(i);
        }
        return sum;
    }
    //求 N 的阶乘
    public static int fac(int n) {
        int ret = 1;
        for (int i = 1; i <= n; i++) {
            ret *= i;
        }
        return ret;
    }
    //创建方法求两个数的最大值max2，随后再写一个求3个数的最大值的函数max3。
    //要求：在max3这个函数中，调用max2函数，来实现3个数的最大值计算
    public static int max2(int a, int b) {
        if(a > b) {
            return a;
        } else {
            return b;
        }
    }
    public static int max3(int a, int b, int c) {
        int max = max2(a, b);
        max = max2(max, c);
        return max;
    }

//获取一个数二进制序列中所有的偶数位和奇数位， 分别输出二进制序列
public static void main2(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int  n = scanner.nextInt();
    for (int i = 31; i >= 1 ; i -= 2) {
        System.out.print(((n >> i) & 1) + " ");//偶数位
    }
    System.out.println();
    for (int i = 30; i >= 0 ; i -= 2) {
        System.out.print(((n >> i) & 1) + " ");//奇数位
    }

}
    public static void main1(String[] args) {
        //二进制中1的个数
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int count = 0;
        while(n != 0) {
            n = n & (n-1);
            count++;
    }
        System.out.println(count);
    }
}